import { createPinia } from 'pinia'
import useAccountStore from './module/account'
import useGlobalStore from '@/store/module/global'
import usePageCommonStore from '@/store/module/page-common'
import useUserStore from '@/store/module/main/system/user'
import useRoleStore from '@/store/module/main/system/role'
import useGoodSkuStore from '@/store/module/main/goods/good-sku'
import type { App } from 'vue'
import {useRoute} from "vue-router";

const pinia = createPinia()

// 加工一下pinia，在挂载的时候也初始化了一些数据
function initializeStore(app: App<Element>) {
  app.use(pinia)
  useGlobalStore().loadInitialData()
}

export default initializeStore
export {
  useAccountStore,
  useGlobalStore,
  usePageCommonStore,
  useUserStore,
  useRoleStore,
  useGoodSkuStore
}
